"""django_train URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic.base import RedirectView
import spider.views as spider_view
import auto_sale.views as auto_sale_view

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^index/', spider_view.index, name='index'),
    url(r'^manage_shop/', spider_view.manage_shop, name='manage_shop'),
    url(r'^get_shop_table_msg/', spider_view.get_shop_table_msg, name='get_shop_table_msg'),
    url(r'^edit_shop/', spider_view.edit_shop, name='edit_shop'),
    url(r'^update_shop/', spider_view.update_shop, name='update_shop'),
    url(r'^delete_shop/', spider_view.delete_shop, name='delete_shop'),
    url(r'^create_shop/', spider_view.create_shop, name='create_shop'),
    url(r'^show_product_list_in_edit_page/', spider_view.show_product_list_in_edit_page,
        name='show_product_list_in_edit_page'),

    url(r'^show_product_list/', spider_view.show_product_list_in_edit_page, name='show_product_list'),
    url(r'^create_or_edit_product/', spider_view.create_or_edit_product, name='create_or_edit_product'),
    url(r'^add_product_booth_and_detail_image/', spider_view.add_product_booth_and_detail_image,
        name='add_product_booth_and_detail_image'),
    url(r'^update_product_list_image/', spider_view.update_product_list_image, name='update_product_list_image'),
    url(r'^publish_product/', spider_view.publish_product, name='publish_product'),
    url(r'^start_crawl_all_shop_product_list/', spider_view.start_crawl_all_shop_product_list,
        name='start_crawl_all_shop_product_list'),
    url(r'^crawl_one_shop_product_list/', spider_view.crawl_one_shop_product_list, name='crawl_one_shop_product_list'),
    # favicon.cio
    # url(r'^favicon\.ico$', 'django.views.generic.simple.redirect_to', {'url': '/static/images/favicon.ico'}),
    url(r'^favicon\.ico$', RedirectView.as_view(url='/static/images/favicon.ico')),

    url(r'^base/', auto_sale_view.base, name='base'),
    url(r'^single/', auto_sale_view.single, name='single'),
]
